package com.glsc.ngateway.common.base.domainmapper;

import com.glsc.ngateway.common.api.platform.dto.it.ServerDeviceExport;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;


public class ServerRowMapper implements RowMapper<ServerDeviceExport> {

    @Override
    public ServerDeviceExport mapRow(ResultSet rs, int rowNum) throws SQLException {
        ServerDeviceExport serverDeviceExport = new ServerDeviceExport();
        serverDeviceExport.setBusinessName(rs.getString("business_name"));
        serverDeviceExport.setNetworkSegment(rs.getString("network_segment"));
        serverDeviceExport.setApplicationDetail(rs.getString("application_detail"));
        serverDeviceExport.setMachineRoom(rs.getString("machine_room"));
        serverDeviceExport.setMachineCab(rs.getString("machine_cab"));
        serverDeviceExport.setMachineUnit(rs.getString("machine_unit"));
        serverDeviceExport.setCapitalType(rs.getString("capital_type"));
        serverDeviceExport.setCapitalTyped(rs.getString("capital_typed"));
        serverDeviceExport.setBrand(rs.getString("brand"));
        serverDeviceExport.setCapitalStyle(rs.getString("capital_style"));
        serverDeviceExport.setBrandType(rs.getString("brand_type"));
        serverDeviceExport.setIp1(rs.getString("ip1"));
        serverDeviceExport.setIp2(rs.getString("ip2"));
        serverDeviceExport.setSn(rs.getString("sn"));
        serverDeviceExport.setOperationSys(rs.getString("operation_sys"));
        serverDeviceExport.setIlo(rs.getString("ilo"));
        serverDeviceExport.setName(rs.getString("name"));
        serverDeviceExport.setDepartment(rs.getString("department"));
        serverDeviceExport.setCcTime(rs.getString("cc_time"));
        serverDeviceExport.setWbTime(rs.getString("wb_time"));
        serverDeviceExport.setMachineStatus(rs.getString("machine_status"));
        serverDeviceExport.setSjTime(rs.getString("sj_time"));

        return serverDeviceExport;
    }
}
